<?=view('admin.common.header')?>
<style>
    .table>tbody>tr>td {vertical-align: middle;}
</style>
<form id="modifyform" action method="post">
<table class="table">
    <tr>
        <td>地区名</td>
        <td>
            <input type="text" name="name" class="form-control" required="required"/>
        </td>
    </tr>
    <tr>
        <td>排序</td>
        <td>
            <input type="text" name="sort" class="form-control" required="required"/>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <button class="btn btn-primary form-control eveModify">添 加</button>
        </td>
    </tr>
</table>
    <script>
        $('.eveModify').click(function(){
            var sort=$('input[name=sort]'), name = $('input[name="name"]').val();
            if (name == '') {
                layer.msg('地区名称不能空');
                return false;
            }
            if (sort == '') {
                layer.msg('排序不能空');
                return false;
            }
            $("#modifyform").ajaxSubmit(function(data){
                layer.msg(data.info);
                if (data.status == 1) {
                    window.parent.location.reload();
                }
            });
            return false;
        })
    </script>
</body>
</html>